{% extends "backend/backendbase.html" %}
{% block users_selected %}class="current"{% endblock %}
{% block tittle %}User Setting{% endblock %}
{% block table_content %}
	<div id="table-content"><form action="" method="post" id="addcategory">	
		<!-- start id-form -->
	{% csrf_token %}
	<table align="center" border="0" cellpadding="0" cellspacing="0" id="id-form">
		<tbody>
		<tr>
			<th valign="top">Username:</th>
			<td><input readonly="readonly" type="text" class="inp-form" name="username" value="{{var_user_edit}}"></td>
			
			<td>
			<div class="error-left" style="visibility: hidden; "></div>
			<div class="error-inner" style="visibility: hidden; "></div>
			</td>	
			
		</tr>
		<tr>
			<th valign="top">Password:</th>
			<td><input type="password" class="inp-form" name="password" value="{{var_password_edit}}"></td>
			
			<td>
			<div class="error-left" style="visibility: hidden; "></div>
			<div class="error-inner" style="visibility: hidden; "></div>
			</td>	
			
		</tr>		 
		<tr>
			<th valign="top">Email:</th>
			<td><input type="text" class="inp-form" name="email" value="{{var_email_edit}}"></td> 
			<td>
			<div class="error-left" style="visibility: hidden; "></div>
			<div class="error-inner" style="visibility: hidden; "></div>
			</td>	
			
		</tr>
		<tr>
			<th valign="top">Phone:</th>
			<td><input type="text" class="inp-form" name="phone" value="{{var_phone_edit}}"></td>
			<td>
			<div class="error-left" style="visibility: hidden; "></div>
			<div class="error-inner" style="visibility: hidden; "></div>
			</td>	
			
		</tr>
		<tr>
			<th valign="top">Company:</th>
			<td><input type="text" class="inp-form" name="company" value="{{var_company_edit}}" charset = "utf8"></td>
			<td>
			<div class="error-left" style="visibility: hidden; "></div>
			<div class="error-inner" style="visibility: hidden; "></div>
			</td>	
			
		</tr>
		<tr>
			<th valign="top">Address:</th>
			<td><input type="text" class="inp-form" name="address" value="{{var_address_edit}}"></td>
			<td>
			<div class="error-left" style="visibility: hidden; "></div>
			<div class="error-inner" style="visibility: hidden; "></div>
			</td>	
			
		</tr>

		<tr>
			
			<td></td>
		</tr>
		<tr>
			<th>&nbsp;</th>
			<td valign="top">
				<input type="submit" value="" class="form-submit" name="submit">
				<input type="reset" value="" class="form-reset" name="reset">
			</td>
			<td></td>
		</tr>
	</tbody></table>


</form>
<script type="text/javascript">
$(document).ready(function(){
	$(".error-inner").each(function(){
		if($(this).html() == '') {
			$(this).css("visibility", "hidden");
			$(this).siblings(".error-left").css("visibility", "hidden");
		}
	});
 	
});
	$(document).ready(function(){		
	 	$("#addcategory").validate({
	    	rules: {
				username: { required: true },
				password: { required: true },
				phone: { digits: true},
				email: {required: true, email: true}
			},
			errorPlacement: function(error, element){		        
		        $(element).parent().next().children(".error-inner").html(error);				
			},
			//errorClass: "",
			highlight: function(element, errorClass) {
				$(element).parent().next().children(".error-left, .error-inner").css("visibility", "visible");
				$(element).removeClass("inp-form");
				$(element).addClass("inp-form-error");
			},
			unhighlight: function(element, errorClass) {
				$(element).parent().next().children(".error-left, .error-inner").css("visibility", "hidden");
				$(element).removeClass("inp-form-error");
				//$(element).addClass("inp-form");
			},
		    
		});
	});
	$(document).ready(function(){
		$(".icon-10").click(function(event){
		if(!confirm("Do you want to delete this user ?")){
			event.preventDefault();
		}
	});

	$(".selectbox-wrapper2 ul li").click(function(){
    	if($(this).html() != "Number of rows") {
			location.href="1?numRow="+$(this).html();
    	}
    });

});
</script>
			
{% endblock %}